<template>
  <el-menu
      :default-active="activeIndex"
      class="el-menu-demo"
      mode="horizontal"
      :ellipsis="false"
      @select="handleSelect"
  >
    <el-menu-item index="0">
      <img style="width: 50px" src="../images/GGbond.jpg" alt="头像"/>
      <el-menu-item index="0-1" @click="tc">退出登录</el-menu-item>
<!--      <el-menu-item index="0-2" @click="tc">注销账户</el-menu-item>-->
    </el-menu-item>
    <div class="flex-grow" />
    <el-menu-item  @click="yh">数字大屏</el-menu-item>
    <el-menu-item index='/home/user' @click="xs">用户管理</el-menu-item>
  </el-menu>
  <router-view></router-view>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import router from "../router/index.js"

const activeIndex = ref('1')
const handleSelect = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const tc = () => {
  router.push("/")
  alert("退出登录成功")
}
const yh = () => {
  window.open("http://localhost:5174", "_blank")
}
const xs = () => {
  router.push("/home/student")
}

</script>

<style>
.flex-grow {
  flex-grow: 1;
}
</style>